const { ccclass, property } = cc._decorator;

@ccclass
export default class pfTitle extends cc.Component {
    @property(cc.Node)
    nodeCoin: cc.Node = null;
    @property(cc.Node)
    nodeTiLi: cc.Node = null;
    @property(cc.Node)
    nodeGoods: cc.Node = null;

    showType;

    //根据不同类型 显示不同节点
    onShowNodeByType(type) {
        this.showType = type;
        switch (type) {
            case "coin":
                this.nodeCoin.active = true;
                break;
            case "tiLi":
                this.nodeTiLi.active = true;
                break;
            case "goods":
                this.nodeGoods.active = true;
                break
        }
    }

    onShowVideoCallback() {
        switch (this.showType) {
            case "coin":
                console.log("type is coin")
                break;
            case "tiLi":
                console.log("type is tiLi")
                break;
            case "goods":
                console.log("type is goods")
                break
        }
    }

    onButtonCloseCallback() {
        this.node.removeFromParent();
    }

}
